using System;
using L2NH.Core.Domain;

namespace L2NH.Core.Presentation
{
   public interface INHibernateDemoPresenter
   {
      void Demo();
   }

   public interface INHibernateDemoView
   {
      void Display(Employee employee);
      string PromptForLastName();
   }

   public class NHibernateDemoPresenter : INHibernateDemoPresenter
   {
      public NHibernateDemoPresenter(INHibernateDemoView view, IRepository repository)
      {
         _view = view;
         _repository = repository;
      }

      private readonly INHibernateDemoView _view;
      private readonly IRepository _repository;

      public void Demo()
      {
         DoRawQuery();
         DoOrderedQuery();
         DoFilteredQuery();
      }

      private void DoRawQuery()
      {
         foreach (Employee employee in _repository.FindAll<Employee>())
            _view.Display(employee);
      }

      private void DoOrderedQuery()
      {
      }

      private void DoFilteredQuery()
      {
      }
   }
}